package com.estronger.shopmanage.ui.aftermarket.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import com.estronger.shopmanage.ui.aftermarket.utils.AftermarketUitl;

import java.util.List;

public class MeasureAdpater extends FragmentStatePagerAdapter {
    List<AftermarketUitl.ViewBean> viewBeanList;
    public MeasureAdpater(FragmentManager fm,List<AftermarketUitl.ViewBean> array) {
        super(fm);
        this.viewBeanList = array;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return viewBeanList.get(position).getTitle();
    }

    @Override
    public Fragment getItem(int position) {
        AftermarketUitl.ViewBean viewBean = viewBeanList.get(position);
        return viewBean.getFragment();
    }

    @Override
    public int getCount() {
        return viewBeanList.size();
    }
}
